﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Attributes;

namespace SelfService.Model.Models
{
    public class SysMedicalProject : TopBasePoco
    {
        [Display(Name = "项目名称")]
        [StringLength(512)]
        public string Name { get; set; }

        [Display(Name = "项目编码")]
        [StringLength(128)]
        public string Code { get; set; }

        [Display(Name = "项目名称")]
        [Column(TypeName = "decimal(12,6)")]
        public decimal Price { get; set; }

        [Display(Name = "是否控制数量")]
        public bool IsControlQty { get; set; }

        [Display(Name = "是否禁用")]
        public bool IsDisable { get; set; }

        [Display(Name = "创建时间")]
        public DateTime? CreateTime { get; set; } = DateTime.Now;

        [Display(Name = "更新时间")] 
        public DateTime UpdateTime { get; set; } = DateTime.Now;
    }

    [MiddleTable]
    public class SysPrescriptionProjects : TopBasePoco
    {
        public SysPrescription Prescription { get; set; }
        
        public Guid? PrescriptionId { get; set; }
        
        public SysMedicalProject Project { get; set; }
        
        public Guid? ProjectId { get; set; }
    }
}
